package reflect;

import java.util.Scanner;

public class ClassDemo02 {
    public static void main(String[] args) throws ClassNotFoundException {
        while (true) {
            System.out.println("please input class name:");
            Scanner sc = new Scanner(System.in);
            String pkgClassName = sc.nextLine();
            if ("exit".equals(pkgClassName))break;
            Class<?> c1 = Class.forName(pkgClassName);
            System.out.println(c1.getName());
            System.out.println(c1.getPackage().getName());
        }
    }
}
